#include <iostream>
#include <cstring>
using namespace std;
const int N = 5010;
int arr[N]={-1}; 
int main()
{
	int n = 0;
	cin >> n;
	memset(arr,-1,(n+1)*sizeof(int));
	for(int i0 = 2;i0 <= n;i0++)
	{
		int j = 0;
		for(j = i0 ;j <= n;j++)
		{
			if(j % i0 == 0)
			{
				arr[j] = -1 * arr[j];
			}
		}
	}
	for(int i2 = 1 ; i2 <= n;i2++)
	{
		if(arr[i2]==-1)
		cout << i2 <<" ";
	}
	cout << endl;
	
	return 0;
 } 
